
<template>
  <div class="container" style>
    <div class="header"></div>
    <div class="content">
      <Table border :columns="columns7" :data="data6"></Table>
    </div>
	<console ref="console"></console>
  </div>
</template>
 
<script>
import console from '@/components/console';
import {Table} from "iview";
	export default {
		data () {
			return {
			env: "",
			podName: "",
			contaName: "",
			logtxt: "",
			terminal: {
			        pid: 1,
			        name: 'terminal',
			        cols: 500,
			        rows: 500
			      },
			columns7: [
                    {
                        title: '名称',
                        key: 'name',
                    },
                    {
                        title: '状态',
                        key: 'statu'
					},
					{
                        title: 'ip地址',
                        key: 'ip'
                    },
                    {
                        title: '操作',
                        key: 'action',
                        width: 150,
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'primary',
                                        size: 'small'
                                    },
                                    style: {
                                        marginRight: '5px'
                                    },
                                    on: {
                                        click: () => {
                                            this.openTerminal(params.row)
                                        }
                                    }
                                }, 'console'),
                            ]);
                        }
                    }
                ],
                data6: [
                    {
						id:'1',
                        name: '服务器1',
                        statu:0,
                        ip: '172.25.26.148',
                        port: 7001
                    },
                    {
						id:'2',
                        name: '服务器2',
                        statu:0,
                        ip: '172.25.26.148',
                        port: 7001
                    },
                    {
						id:'3',
                        name: '服务器3',
                        statu:0,
                        ip: '172.25.26.148',
                        port: 7001
                    },
                    {
						id:'4',
                        name: '服务器4',
                        statu:0,
                        ip: '172.25.26.148',
                        port: 7001
                    }
                ]	
			}
		},
		methods: {
			openTerminal({ip,id,port}){
				const console = this.$refs.console;
				console.open({ip,id,port});
			}
		},
		mounted(){
		  
		},
 
		components: {
		    'console': console
		}
	}
</script>
 
<style scoped lang="less">
.container {
  height: 100%;
  width: 100%;
  position: relative;
  .header {
    height: 60px;
    width: 100%;
    background: #19b7bd;
  }
}
</style>
